<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>统计</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/animate.min.css" th:href="@{/css/main/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/main/style.min862f.css" th:href="@{/css/main/style.min862f.css}" rel="stylesheet"/>
    <link href="../static/css/chart/demo.css" th:href="@{/css/chart/demo.css}" rel="stylesheet" type="text/css" />
    <link href="../static/css/chart/jqbar.css" th:href="@{/css/chart/jqbar.css}" rel="stylesheet" />
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-success pull-right">人次</span>
                        <h5>投票用户</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 id="userNum" class="no-margins" th:text="${userNum}"></h1>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>候选人得票数(同态加密计算得出)</h5>
                        <div class="ibox-tools">
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div id="skillset" class="sixteen columns">
                                <div class="eight columns">
                                        <div class="bars MT30">
                                                <div id="bar-1"></div>
                                                <div id="bar-2"></div>
                                                <div id="bar-3"></div>
                                                <div id="bar-4"></div>
                                                <div id="bar-5"></div>
                                                <div id="bar-6"></div>
                                        </div>
                                </div>
                                <div class="two columns">
                                </div>
                                <div class="clearfix">
                                </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/jquery-ui-1.10.4.min.js?v=4.6.0}"></script>
    <script th:src="@{/ajax/libs/flot/jquery.flot.js}"></script>
    <script th:src="@{/js/chart/jqbar.js}"></script>    <!-- 验证插件 -->
    <script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
    <script src="../static/ajax/libs/validate/messages_zh.min.js" th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
    <script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
    <script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
    <script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.6.0}"></script>
    <script src="../static/ruoyi/js/common.js" th:src="@{/ruoyi/js/common.js?v=4.6.0}"></script>
    <th:block th:include="include :: sparkline-js" />
    <script th:inline="javascript">
        $(function(){
            var ctx = [[@{/}]];
            var prefix = ctx + "vote/staff";
            var da = ['#D64747', '#FF681F', '#ea805c', '#88bbc8', '#939393', '#3a89c9'];
            $.operate.ajaxpost(prefix + "/vnu", {}, function(ret){
                if(ret && ret.data){
                    $("#userNum").html(ret.data);
                }
            });
            $.operate.ajaxpost(prefix + "/vnt", {}, function(ret){
                if(ret && ret.data){
                    $.each(ret.data, function(index,data){
                        $("#bar-" + (index + 1)).jqbar({ label: data['name'], value: data['counter'], barColor: da[index]});
　　　　　　　　　　});
                }
            });
        });
    </script>
</body>
</html>
